<?php

namespace pam\Service;

/**
 * Description of PolicyService
 *
 * @author Robert Bwana
 */

use pam\Model\Policy;
use pam\Model\PolicyGoal;
use pam\Mapper\PolicyDataAccess as pda;


class PolicyService {
    protected $pda;
    
    public function __construct(pda $pda) {
        $this->pda = $pda;
    }
    
    public function deletePolicy(Policy $policy) {
        return $this->pda->delete($policy->id);
        //return $this->socialPolicyDA->delete($policy->getId());
    }

    public function findAll() {
        return $this->pda->findAll();
    }

    public function findPolicy($id) {
        return $this->pda->find($id);
    }
    
    public function findGoals($id) {
        return $this->pda->findPolicyGoals($id);
    }

    public function savePolicy(Policy $policy) {
        return $this->pda->save($policy);
    }
    
    public function savePolicyGoals(array $policyGoals) {
        return $this->pda->saveGoals($policyGoals);
    }    
}
